from pathlib import Path
import random
from shutil import copytree, ignore_patterns

p=Path('/tmp/a/b/c/d')
p1=Path('/tmp/a/b/c')
p2=Path('/tmp/a/b')
p3=Path('/tmp/a')
d=Path('/tmp/dst/a/b/c/d')
p.mkdir(parents=True,exist_ok=True)

i=j=z=f=0
while i < 12:
   s=random.sample(['e','f','g','h','i','j','k','x','y','z'],4)
   st= ''.join(s)
   (p / st).touch()
   i+=1
while j < 12:
   s=random.sample(['e','f','g','h','i','j','k','x','y','z'],4)
   st= ''.join(s)
   (p1 / st).touch()
   j+=1
while z < 12:
   s=random.sample(['e','f','g','h','i','j','k','x','y','z'],4)
   st= ''.join(s)
   (p2 / st).touch()
   z+=1
while f< 14:
   s=random.sample(['e','f','g','h','i','j','k','x','y','z'],4)
   st= ''.join(s)
   (p3 / st).touch()
   f+=1
shutil.copytree('/tmp/a','/tmp/dst',ignore=ignore_patterns('e*','f*','g*','h*','i*','j*','k*'))


# 这里shutil导入其他的话，不可以直接使用shutil，ignore的方式可以试试别的写法
